package com.jam.cloud.order.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
@LoadBalancerClient(name = "userserver",configuration = LoadBalancerConfig.class)
public class RestTemplateConfig {

    @Bean
    @LoadBalanced //LoadBalancerInterceptor
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }


    //最新的eureka client集成的负载均衡已经替换为spring 的loadbalancer
    // https://www.cnblogs.com/fb010001/p/14613428.html
}
